package com.sina.mysql.utils;

import java.util.*;

/**
 * @ClassName ArrayUtils
 * @Description:
 * @Author 段浩杰
 * @Date 2018/8/22 17:33
 * @Version 1.0
 */
public abstract class ArrayUtils {

    public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];

    public static final String[] EMPTY_STRING_ARRAY = new String[0];

    public static final Integer[] EMPTY_INTEGER_ARRAY = new Integer[0];

    public static final int[] EMPTY_INT_ARRAY = new int[0];


    public static <T> Set<T> asSet(T... e) {
        Set<T> set = new HashSet<>();
        Collections.addAll(set, e);
        return set;
    }

    public static <T> Set<T> asUnmodifiableSet(T... e) {
        return Collections.unmodifiableSet(asSet(e));
    }

    public static <T> List<T> asUnmodifiableList(T... e) {
        return Collections.unmodifiableList(Arrays.asList(e));
    }


}